
package com.market.web.action;

import com.market.bean.Product;
import com.market.constant.Constant;

public class AdminProDelAction extends AdminProductAction
{
    public String execute() throws Exception
    {
        long id = getLong("id");
        Product pro = getProductService().findById(id);
        if (pro != null)
        {
            try
            {
                getProductService().delete(id);
                delImg(pro.getId() + pro.getPic(), Constant.PRODUCT_PIC_FOLDER);
            }
            catch (Exception e)
            {
                logger.error("",e);
            }
        }
        return SUCCESS;//mapping.findForward("adminProSearch");
    }
}
